﻿using locationModule.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ReactiveUI;
using System.Windows;
using System.Collections.ObjectModel;
using locationModule.ServiceReference1;
using System.ComponentModel;
using Microsoft.Practices.Prism.Mvvm;
using Microsoft.Practices.Prism.Commands;
using System.Windows.Input;

namespace locationModule.ViewModels
{
    public class MainViewModel :BindableBase

    {
        
        ServiceReference1.Container context = new ServiceReference1.Container(new Uri("http://localhost:12951/odata"));
        public MainViewModel()
        {

            this.InsertCommand = new DelegateCommand(this.ProcessOrder);
        }
        

        public ICommand InsertCommand { get; private set; }
        Location_table lotable;
        private void ProcessOrder()
        {
            //var location = from loca in context.Location_table
            //               select loca;
            //MessageBox.Show(location.Count().ToString());
        }

        public Location_table Lotable
        { 
            get
            {
                return lotable;
            }
            set
            {
                lotable = value;
            }
        }

        ObservableCollection<Location_table> lotables;
        public ObservableCollection<Location_table> Lotables
        {
            get
            {
                return lotables;
            }
            set
            {
                lotables= value;
            }
        }
        
    }
}
